package com.service.Impl;

import com.dao.VideoDao;
import com.mypg.Video;
import com.service.VideoService;

import java.util.List;

public class VideoServiceImpl implements VideoService {

    private VideoDao videoDao;

    public VideoServiceImpl(){}
    public VideoServiceImpl(VideoDao videoDao) {
        this.videoDao = videoDao;
    }

    @Override
    public List<Video> selectAllVideo() {
        return videoDao.selectAllVideo();
    }

    @Override
    public Video selectVideoByVideo_id(int video_id) {
        return videoDao.selectVideoByVideo_id(video_id);
    }

    @Override
    public List<Video> selectVideoFor_video_table_jsp(String video_class, String video_class_sub, int start_row, int page_nums) {
        return videoDao.selectVideoFor_video_table_jsp(video_class,video_class_sub,start_row,page_nums);
    }

    @Override
    public int selectVideo_count_For_video_table_jsp(String video_class, String video_class_sub) {
        return videoDao.selectVideo_count_For_video_table_jsp(video_class,video_class_sub);
    }

    @Override
    public int selectVideo_count() {
        return videoDao.selectVideo_count();
    }

    @Override
    public List<Video> selectVideoByVideo_class_sub(String video_class_sub) {
        return videoDao.selectVideoByVideo_class_sub(video_class_sub);
    }

    @Override
    public void insertVideo(Video video) {
        videoDao.insertVideo(video);
    }

    @Override
    public void deleteVideoByVideo_id(int video_id) {
        videoDao.deleteVideoByVideo_id(video_id);
    }

    @Override
    public void updateVideoByVideo_id(Video video) {
        videoDao.updateVideoByVideo_id(video);
    }

    @Override
    public void updateVideo_imgByVideo_id(String video_img, int video_id) {
        videoDao.updateVideo_imgByVideo_id(video_img,video_id);
    }

    public VideoDao getVideoDao() {
        return videoDao;
    }

    public void setVideoDao(VideoDao videoDao) {
        this.videoDao = videoDao;
    }
}
